Introduction: Python® scripting with the Python® scripting block

The Python scripting block allows you to manipulate fields through a Python script, taking advantage of the capabilities provided by the Python® scripting language.

Python scripting allows you to introduce new fields or manipulate existing ones, by means of code written in Python. The value, timestamp, and quality of output fields are controlled by this script. Scripting can be incorporated into your blueprint solution using the Python Scripting block in Architect.

Script execution

The script is run from top to bottom on every execution.

If your script enters an infinite loop, the software may become unresponsive.

Block execution stops if any unhandled exceptions are raised. For example, an exception is raised in the case of division by zero. If this exception is not handled by your script, block execution stops.

Limitations

Blacklisted items

Some Python nodes, attributes, builtins, and functions are blacklisted, which means that you cannot use them in your script. If you attempt to use them, script verification will fail and an error message will indicate the source of the failure.

Field names

When naming your input fields and output fields, do not use Python reserved words for field names, as these clash with Python reserved words in the script. If you attempt to use reserved words for field names, script verification will fail and an error message will indicate the source of the failure.

Timestamps

See the Important notes on field timestamps topic for details on timestamp format as well as upper and lower bounds on the timestamp.


Related topics:

  

CSense 2023- Last updated: June 24,2025